<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#import "/common/page.ftl" as p>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${this[0].getText("project_name")}</title>
<link type="text/css" href="${base}/static/css/style.css" rel="stylesheet" rev="stylesheet" />
<link rel="stylesheet" type="text/css" href="${base}/static/js/validate/css/screen.css" />


<script type="text/javascript" src="${base}/static/js/jquery.js"></script>
<script type="text/javascript" src="${base}/static/js/calendar/WdatePicker.js"></script>
<script type="text/javascript" src="${base}/static/js/validate/validate.js"></script>
<script type="text/javascript" src="${base}/static/js/validate/cmxforms.js"></script>
</head>
<body>

<div class="main_content">

<br/>
<h2>用户列表</h2>
<form id="form1" action='${base}/user/list' method='post'>
	<input type="button" value=" 新增用户" id="addBtn">
    <table width="100%" cellspacing="0" class="datalist" style="width:60%">
    	<tr>
			<th width='20%'>ID</th>
			<th width='15%'>真实名称</th>
    		<th width='15%'>角色</th>
			<th width='20%'>所属机构</th>
    		<th width='15%'>操作</th>
			<th width='15%'>注册</th>
    	</tr>	   	
        <#list page.items as user>
    	<tr>
			<td><#if user.roles?size gt 0>${user.name!}</#if>&nbsp;</td>
			<td>${user.realname!}&nbsp;</td>
    		<td><#list user.roles as role>${role.description}&nbsp;</#list>&nbsp;</td>
			<td>${user.cityString!}&nbsp;</td>
    		<td><a href="${base}/user/edit?user.id=${user.id!}">修改</a>&nbsp;<a href="${base}/user/del?user.id=${user.id!}">删除</a></td>
			<td><#if user.roles?size==0><font color="red">未注册</font><#else>已注册</#if></td>
    	</tr>	
        </#list>
    </table>
    <@p.pageView 'form1'/>
</form>
</div>
<script type="text/javascript">
 $("#addBtn").bind("click",function(){
 	window.location.href="${base}/user/add";
 });
</script>
</body>
</html>
